/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */

package cn.webrx;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * <p>Project: jse2303 - Set2
 * <p>Powered by webrx On 2023-07-19 15:58:26
 * <p>描述：<p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Set2 {
    public static void main(String[] args) {
        //消除List集合中的重复数据
        List<Integer> list = new ArrayList<>(List.of(1, 1, 1, 1, 1, 10, 20, 30, 20, 50));
        System.out.println(list);
        System.out.println(list.size());


        Set<Integer> set = new HashSet<>(list);
        System.out.println(set);
        System.out.println(set.size());

        list = new ArrayList<>(set);
        System.out.println(list);
        System.out.println(list.size());
    }
}


